package com.uzai.console.service.feign;

import com.uzai.console.common.UzaiRespVo;
import com.uzai.console.dto.feign.alarm.AlarmMsgFeignDto;
import com.uzai.console.dto.feign.fdSendJob.FdSendJobIdFeignDto;
import com.uzai.console.dto.feign.groupsendjob.GroupSendChildidPushDto;
import com.uzai.console.dto.feign.groupsendjob.GroupSendJobIdFeignDto;
import com.uzai.console.dto.feign.groupsendjob.NewGroupSendMsgDto;
import com.uzai.console.dto.feign.pyq.DeletePyqDto;
import com.uzai.console.dto.feign.pyq.SendPyqDto;
import com.uzai.console.entity.es.EsFdGroupSendMsg;
import com.uzai.console.entity.es.PyqJobDetail;
import com.uzai.console.service.feign.impl.UzaiBroadcastFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 群发微服务
 * @Auther: jianghan
 * @Date: 2021/11/24 16:22
 * @Description:
 */
@Component
@FeignClient(value = "uzai-broadcast-server", fallbackFactory = UzaiBroadcastFeignFallbackFactory.class)
public interface UzaiBroadcastFeignService {

    /**
     * 发送朋友圈
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param sendPyqDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/pyq/send/byid")
    UzaiRespVo<Boolean> sendPyqById(@RequestBody SendPyqDto sendPyqDto);

    /**
     * 删除朋友圈
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param deletePyqDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/pyq/delete")
    UzaiRespVo<Boolean> deletePyq(@RequestBody DeletePyqDto deletePyqDto);

    /**
     * 发系统告警消息
     * @author lucher
     * @date 2021/11/29 10:25
     * @param alarmMsgFeignDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/sys/msg/push")
    UzaiRespVo<Boolean> sysMsgPush(@RequestBody AlarmMsgFeignDto alarmMsgFeignDto);

    /**
     * 推送朋友圈消息,参数传集合
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param pyqJobDetailList
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/pyq/msg/push")
    UzaiRespVo<Boolean> pyqMsgPush(@RequestBody List<PyqJobDetail> pyqJobDetailList);

    /**
     * 推送群发消息,参数传集合
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param newGroupSendMsgDtoList
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/group/send/msg/push")
    UzaiRespVo<Boolean> groupSendMsgPush(@RequestBody List<NewGroupSendMsgDto> newGroupSendMsgDtoList);

    /**
     * 推送群发消息子任务
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param groupSendChildidPushDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/group/send/childid/push")
    UzaiRespVo<Boolean> groupSendChildIdPush(@RequestBody GroupSendChildidPushDto groupSendChildidPushDto);

    /**
     * 查询群发完成数量
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param groupSendJobIdFeignDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    //@PostMapping("/groupsend/finish/count")
    //UzaiRespVo<Integer> groupSendFinishCount(@RequestBody GroupSendJobIdFeignDto groupSendJobIdFeignDto);

    //-----------------------------------------------

    /**
     * 查询发单发送消息完成数量
     * @author lucher
     * @date 2022/12/08 10:25
     * @param fdSendJobIdFeignDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/fd/send/finish/count")
    UzaiRespVo<Integer> fdSendFinishCount(@RequestBody FdSendJobIdFeignDto fdSendJobIdFeignDto);

    /**
     * 此方法已经废弃不用了。改成了直接保持到MQ消息里
     * 推送发单群发消息,参数传集合
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param esFdGroupSendMsgList
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/fd/send/msg/push")
    UzaiRespVo<Boolean> fdSendMsgPush(@RequestBody List<EsFdGroupSendMsg> esFdGroupSendMsgList);

    /**
     * 推送社群群发动子任务id
     * @author jitwxs
     * @date 2021/11/29 10:25
     * @param fdSendJobIdFeignDto
     * @return com.uzai.console.common.UzaiRespVo<java.lang.Boolean>
     */
    @PostMapping("/fd/push/childid")
    UzaiRespVo<Object> fdPushChildid(@RequestBody FdSendJobIdFeignDto fdSendJobIdFeignDto);

}
